#ifndef FTLATLONEDIT_H
#define FTLATLONEDIT_H

#include "ftbasicwidget.h"

#include <QGeoCoordinate>
QTM_USE_NAMESPACE

class FTLatLonEdit : public FTBasicWidget
{
    Q_OBJECT
public:
    explicit FTLatLonEdit(double a = 0.0,
                          double o = 0.0,
                          Qt::Orientation x = Qt::Horizontal,
                          QWidget* parent = NULL);

    void setEdit(bool);
    bool isEdit() const;

    double latitude() const;
    double longitude() const;

    void setLatLon( double, double );
    void setOrientation(Qt::Orientation);

    void paintEvent(QPaintEvent *);
    void mousePressEvent(QMouseEvent *);
    void mouseReleaseEvent(QMouseEvent *);

    QSize sizeHint() const;
    QSize minimumSizeHint() const;

signals:
    void updated(double, double);

private slots:
    void formatChanged();

private:
    QGeoCoordinate latlon;
    QString calculatedString;

    Qt::Orientation _orientation;
    int mouse_down;

    void makeText();
    bool _edit;
};

#endif // FTLATLONEDIT_H
